package iss.java;

/**
 * Created by WeiZehao on 16/10/9.
 */
public class Student
{
    private String _name;           // 姓名
    private String _id;             // 学号
    private double[] _grades;       // 五门课成绩
    private double _totalMark;      // 总评成绩

    public Student(String name, String id)
    {
        _name = name;
        _id = id;
        _grades = new double[5];
        _totalMark = 0;
    }

    public String get_name()
    {
        return _name;
    }

    public String get_id()
    {
        return _id;
    }

    public double[] get_grades()
    {
        return _grades;
    }

    public double get_totalMark()
    {
        return _totalMark;
    }

    public void set_grades(double chinese, double math, double english, double physics, double chemistry)
    {
        _grades[0] = chinese;
        _grades[1] = math;
        _grades[2] = english;
        _grades[3] = physics;
        _grades[4] = chemistry;

        // 计算总评成绩
        for (double i : _grades)
        {
            _totalMark = _totalMark + i;
        }
    }
}// end class Student
